home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12100 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: news.athene.co.uk!not-for-mail
  3. From: "C.J. Scaife" <JOLTSWIFT@Athene.co.uk>
  4. Subject: Re: extern consts
  5. Message-ID: <314D2BDF.1538@Athene.co.uk>
  6. Date: Mon, 18 Mar 1996 09:24:47 +0000
  7. References: <4idbcv$ue2@news7.erols.com> <314c2077.138956468@nntp.ix.netcom.com> <4ii7h9$bq6@news6.erols.com>
  8. Organization: JoltSwift Ltd.
  9. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  10. MIME-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13.  
  14. Chris Cobb wrote:
  15. > miker3@ix.netcom.com (Mike Rubenstein) wrote:
  16. > >
  17. > >It's not legal.  extern const is legal, but in any compilation unit
  18. > >that does not see the initializer the const variable is not a constant
  19. > >expression.
  20. > >
  21. > Well, your comment makes sense.  However, in a way it seem
  22. > self-contradictory.  If a const can be extern, then it no longer is a
  23. > const: you've basically externed away constness.  But if thats what
  24. > externinig a const does, it doesn't make sense to allow it at all (which
  25. > is what happens on most compilers.)
  26. > ChrisI disagree, const merely aims to prevent unintentional changes to the 
  27. data, and there is no reason why it's value can't be held in an external 
  28. module. afterall you might want to take the address of a constant, which 
  29. you can't do with a #define!
  30.  
  31.